package nc.bs.client.util;

import java.util.Map;

import nc.bs.dao.BaseDAO;
import nc.jdbc.framework.processor.MapProcessor;
import nc.vo.pub.BusinessException;

public class ClientUtils {
	private static BaseDAO baseDAO;
	
	/**
	 * ?????????
	 * @param fourpro
	 * @return
	 * @throws BusinessException
	 */
	public static Map<String, Object> queryFourCGproject(Object fourpro) throws BusinessException {
		if(fourpro == null) return null;
		String sql = buildFourCGProject(fourpro);
		Object obj = getBaseDAO().executeQuery(sql, new MapProcessor());
		if(obj == null) return null;
		Map<String,Object > res =  (Map<String,Object>)obj;
		return res;
	}
	
	/**
	 * ?????????????sql
	 * @param fourpro ?????????
	 * @return
	 * @throws BusinessException
	 */
	private static String buildFourCGProject(Object fourpro) throws BusinessException{
        String sql = " select  " +
                "    * " +
                " from hrpbm_sjxmh " +
                " where 1 = 1 " +
                "   and  dr = 0 " +
                "   and approvestatus = 1 " +
                "   and pk_sjxm = '" + fourpro + "'";
		return sql;
	}

	private static BaseDAO getBaseDAO() {
		return baseDAO == null ? new BaseDAO() : baseDAO;
	}
	
	
}
